﻿<%@ include file="../include/top.jsp"%>
<%@ include file="../include/errorArea.jsp" %>
<link rel="stylesheet" href="${baseURL}/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script language="javascript" type="text/javascript" src="${baseURL}/js/jquery.ztree.all-3.5.min.js">
</script>
<script  type="text/javascript" src="${baseURL}/js/jquery.validate.js"></script>
<script  type="text/javascript" src="${baseURL}/js/jquery-1.8.3.js"></script>
<SCRIPT type="text/javascript">
	var setting = {
		view: {
			dblClickExpand: false
		},
		data: {
			simpleData: {
				enable: true
			}
		},
		callback: {
			onClick: onClick
		}
	};

	var zNodes = ${treedata}; //后台返回的数据

	function onClick(e,treeId, treeNode) {
		var zTree = $.fn.zTree.getZTreeObj("treeDemo");
		zTree.expandNode(treeNode);

		//叶节点，并且不是第一层节点(第一层节点的pId是null)
		//if(!treeNode.isParent && treeNode.pId!=null){
			nodes = zTree.getSelectedNodes();
			$("#selectedNodeName").attr("value", treeNode.name);
			$("#nodeId").attr("value", treeNode.id);
		//}
	}

	function showMenu() {
		var cityObj = $("#selectedNodeName");
		var cityOffset = $("#selectedNodeName").offset();
		$("#menuContent").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");

		$("body").bind("mousedown", onBodyDown);
	}
	function hideMenu() {
		$("#menuContent").fadeOut("fast");
		$("body").unbind("mousedown", onBodyDown);
	}
	function onBodyDown(event) {
		if (!(event.target.id == "menuBtn" || event.target.id == "selectedNodeName" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
			hideMenu();
		}
	}

	$(document).ready(function(){
		$.fn.zTree.init($("#treeDemo"), setting, zNodes);
		
		var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
		var nodes = treeObj.getNodesByParam("id", "${formdata.nodeId}", null);
		if (nodes.length>0) {
			treeObj.selectNode(nodes[0]);
		}

	});
	$('#print_button').click(function(){
		$('#printArea').printArea();
	});
</SCRIPT>
<div id="printArea">
<c:if test="${not empty obj.list}">

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" id="listOutTable">
  <tr>
    <td colspan="2" align="left" valign="middle" class="text_gray2"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#96bee2">
      <tr>
        <td height="21" background="${baseURL}/images/table_bg.jpg">&nbsp;&nbsp;
        <span class="text_blue_b">
        <img src="${baseURL}/images/008.png" width="16" height="16" align="absmiddle" />&nbsp;订单列表：</span></td>
      </tr>
      <tr>
        <td height="13" valign="top" bgcolor="#FFFFFF">
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF" id="listTable">

	<c:forEach var="product" items="${obj.list}">  
                   <div class="s-order-box">
                        <table cellpadding="0" cellspacing="0" class="sell-orderlist-table x-l-table">
                        <tbody>
                        <tr>
                        <td class="no_padding">
                        <div class="text_left bg">
                        		订单号：${product.orderId} ，
                        		下单时间 : <fmt:formatDate value="${product.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>，        		
                        		配送地址：${product.address} 
                        </div>
                        <div class="x-l-proList2 cf">
	                                <div class="pro-img">
		                              商品名称： ${product.productName}-${product.productFieldValue}
		                               订购数量： ${product.productCount}
		                             <span class="span-left span-color">
                        	<c:if test="${product.status==0}">待付款</c:if>
                        	<c:if test="${product.status==1}">已付款</c:if>
                        	<c:if test="${product.status==2}">已发货</c:if>
                        	<c:if test="${product.status==3}">已完成</c:if>
                        	<c:if test="${product.status==4}">已取消</c:if>
                        	<c:if test="${product.status==5}">已送达社区服务站</c:if>
                        	<c:if test="${product.status==6}">已配货</c:if>
                        </span>   
	                                </div>
                        </div>
                        
                       <div style="display:none;" class="line_bottom"></div>                  
         </td>
                        </tr>
                        </tbody></table>
                      </div>
                </c:forEach>
        </table>
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#A6CAE8">
   <!--  <input type="button"  id="print_button" class="button_01_lef" value="打印" />
		 -->						
    </td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#A6CAE8"></td>
  </tr>
</table>
<script src="${ctx}/js/listProduct.js"></script>
</c:if>
</div>
<%@ include file="../include/bottom.jsp"%>